package com.lb.jwitter.service;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lb.jwitter.*;
import com.lb.jwitter.hibernate.*;
import com.lb.jwitter.util.ConditionReport;

@Service("tbl_ThongTin_HocVien_DTBService")
@Transactional
@WebService(endpointInterface = "com.lb.jwitter.service.Tbl_ThongTin_HocVien_DTBService")
public class Tbl_ThongTin_HocVien_DTBServiceImpl implements Tbl_ThongTin_HocVien_DTBService,Serializable {

   private Log log = LogFactory.getLog(Tbl_ThongTin_HocVien_DTBServiceImpl.class);
   private static final long serialVersionUID = -8740095022264495229L;

   @Autowired
   @Qualifier("tbl_ThongTin_HocVien_DTBDAO")
   private Tbl_ThongTin_HocVien_DTBDAO _tbl_ThongTin_HocVien_DTBDao;

   @Autowired
   @Qualifier("tbl_ThongTin_HocVienDAO")
   private Tbl_ThongTin_HocVienDAO _tbl_ThongTin_HocVienDao;

   public final List<Tbl_ThongTin_HocVien_DTB> findAlltbl_ThongTin_HocVien_DTB(int pageSize, int page){
   List<Tbl_ThongTin_HocVien_DTB> result = get_tbl_ThongTin_HocVien_DTBDao().findAll(pageSize, page);
       log.info("Number of user in DB:: "+result.size());
       return result;
   }

   @Transactional(noRollbackFor=IllegalArgumentException.class)
   public final Long createtbl_ThongTin_HocVien_DTB(Tbl_ThongTin_HocVien_DTB obj){
       return _tbl_ThongTin_HocVien_DTBDao.save(obj);
   }

   public final void updatetbl_ThongTin_HocVien_DTB(Tbl_ThongTin_HocVien_DTB obj){
       _tbl_ThongTin_HocVien_DTBDao.update(obj);
   }//end update methode

   public final Tbl_ThongTin_HocVien_DTB gettbl_ThongTin_HocVien_DTB (Long id){
       log.info("Try to retrieve the tbl_ThongTin_HocVien_DTB: "+id);
       return get_tbl_ThongTin_HocVien_DTBDao().get(id);
   }

   public void deletetbl_ThongTin_HocVien_DTB(Long id){
       log.info("Try to delete the tbl_ThongTin_HocVien_DTB by Id : "+ id);
       if(_tbl_ThongTin_HocVien_DTBDao.exists(id)){
	    _tbl_ThongTin_HocVien_DTBDao.delete(id);
       } else {
       	throw new IllegalArgumentException("EmployeeId '"+id+"' does not exists");
       }
   }

   public void deleteListtbl_ThongTin_HocVien_DTB(String[] listId){
       for(String id : listId){
   	    deletetbl_ThongTin_HocVien_DTB(Long.parseLong(id));
       }
   }

   public List<Tbl_ThongTin_HocVien_DTB> findtbl_ThongTin_HocVien_DTBByCondition(List<ConditionReport> cons,int pageSize,int page){ 
       return _tbl_ThongTin_HocVien_DTBDao.findByCondition(Tbl_ThongTin_HocVien_DTB.class, cons, pageSize, page); 
   } 
 
   public int counttbl_ThongTin_HocVien_DTBByCondition(List<ConditionReport> cons){ 
       return _tbl_ThongTin_HocVien_DTBDao.countByCondition(Tbl_ThongTin_HocVien_DTB.class, cons); 
   } 
 
   public final Tbl_ThongTin_HocVien_DTBDAO get_tbl_ThongTin_HocVien_DTBDao() {
   	return _tbl_ThongTin_HocVien_DTBDao;
   }
   public final void set_tbl_ThongTin_HocVien_DTBDao(Tbl_ThongTin_HocVien_DTBDAO obj) {
   	this._tbl_ThongTin_HocVien_DTBDao = obj;
   }

   public Tbl_ThongTin_HocVienDAO get_tbl_ThongTin_HocVienDao() {
       return _tbl_ThongTin_HocVienDao;
   }
   public void set_tbl_ThongTin_HocVienDao(Tbl_ThongTin_HocVienDAO _tbl_ThongTin_HocVienDao) {
       this._tbl_ThongTin_HocVienDao = _tbl_ThongTin_HocVienDao;
   }

}//endclass

